<?php
/**
 * RedCross Application
 *
 * @copyright Copyright (c) 2010, Kristian Stokke Tryggestad, Rune Vikestad, Andreas Flaten Wist, Simen Nicolai Echholt, Ole Henrik Jahren
 */


class Admin_Form_Course_Archive extends RedCross_Form
{
	const ACTION = 'archive';
	
    public function init()
    {
		parent::init();

		$action = $this->createElement('hidden','action');
		$action->setValue(self::ACTION);
		$this->addElement($action);
				
		$this->addElement('submit', 'submit', array(
            'required' => true,
            'ignore'   => true,
            'label'    => 'Arkiver kurs',
        ));		
    }
    
    public function fillForm(Core_Model_Course $course)
    {
        if (is_null($course->archived_date))
        {
            $this->getElement('submit')->setLabel('Arkiver kurs');
        } else
        {
            $this->getElement('submit')->setLabel('Gjenopprett kurs');
        }
    }
}
